package cn.pfz.domain;

import cn.pfz.Utils.MyJsonUtil;
import cn.pfz.statusnum.AppointmentstatusEnum;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Data
public class Appointment {

    private Long id;

    private String ano;

    private Integer status;

    private Long category_id;

    private String info;

    private String contact_tel;

    private String contact_name;

    private Long business_id;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date create_time;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date appointment_time;

    private String category_title;
    
    private String business_name;

    public String getJson() throws Exception{

        return MyJsonUtil.getJson(this,Appointment.class,"yyyy-MM-dd HH:mm");
    }
public String getStatusName(){
        return AppointmentstatusEnum.getName(this.status);
}

}